<script language="javascript" type="text/javascript"
	src="<?php echo $this->load->config->item('base_url') . $this->load->config->item('inc_folder'); ?>scripts/jquery-2.0.3.js"></script>
<script type="text/javascript">
	$(function() {  
        $('#tglawal').datepicker({
			dateFormat:'yy-mm-dd',
			buttonImage:'assets/images/calendar.gif',
			buttonImageOnly : true,
			showOn : 'button'
		});  
    });  
	
	$(function() {  
        $('#tglakhir').datepicker({
			dateFormat:'yy-mm-dd',
			buttonImage:'assets/images/calendar.gif',
			buttonImageOnly : true,
			showOn : 'button'
		});  
    });  
</script>


<h1><?php //echo $nama_perusahaan; ?></h1>
<h2><?php //echo $alamat_perusahaan; ?></h2>
    <div id="body">
        <?php
            //echo $bio;
            //echo $menu;
        ?>
        <div class="cleaner_h10"></div>
        <table align="center">
            <tr align="center">
                <td>
                    <?php
                        //echo $paginator;
                    ?>
                </td>
            </tr>
        </table>
		<div class="cleaner_h10"></div>
        <form method="post" name="frmSearch" action="<?php echo site_url('lapaccountbankcontroller');?>">
		<table width="100%" cellpadding="3" cellspacing="0" border="1">
			<tr>
                <td width="90">Tanggal</td>
                <td>:</td>
                <td width="172"><input type="text"  name="tglawal" id="tglawal" maxlength="10" value="" style="width:110px;"/></td>
                <td width="30">S/D </td>
                <td width="542"><input type="text"  name="tglakhir" id="tglakhir" maxlength="10" value="" style="width:110px;"/></td>
            </tr>
            <tr>
            	<td width="90">Pilih Bank</td>
                <td width="9">:</td>
                <td colspan="3">
                    <select name="bankcode" id="bankcode">
                    <option value="">-Pilih-</option>
                    <?php 
						$count = count($masterbank);
                    	foreach($masterbank as $item)
						{
                    ?>
                    	<option value="<?php echo $item->KodeBank?>"><?php echo $item->Bankname;?></option>
                    <?php }?>
                </select>
                </td>
            </tr>
			<tr valign="top" align="center">
            	<td>&nbsp;</td>
                <td colspan="5"><input type="submit" value="Search" name="btnview" ></td>
			</tr>
		</table>
        </form>
        <br />
      	<div class="cleaner_h10"></div>
        <?php
		if (isset($_POST['btnview']))
		{
			$bankcode = trim($_POST['bankcode']);
			$tglawal = trim($_POST['tglawal']);
			$tglakhr = trim($_POST['tglakhir']);
		}else{
			$bankcode = "";
			$tglawal = "";
			$tglakhr = "";
		}
		?>
        <form method="post" name="frmexcel" action="<?php echo site_url("lapaccountbankcontroller/toExcel?bankcode=".$bankcode."&tglawal=".$tglawal."&tglakhir=".$tglakhr."");?>">
        	<?php if(isset($tglAwal) && isset($tglAkhir)){?>
	        <input type="hidden" name="tglAkhir" value="{tglAkhir}" />
	      	<input type="hidden" name="tglAwal" value="{tglAwal}" />
	      	<?php }?>
	      	<?php if(isset($kdbank)){?>
	      	<input type="hidden" name="kodeBank" value="{kdbank}" />
	      	<?php }?>
            <table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
                <tr style="background-color:#000000; color:#FFFFFF;" align="center">
                    <td colspan="7" height="25">Laporan Account Bank</td>
                </tr>
                <tr style="background-color:#333; color:#FFFFFF;" align="center">
                    <td>Kode Bank</td>
                    <td>Nama Bank</td>
                    <td>No Rekening</td>
                    <td>Saldo Awal</td>
                    <td>Uang Masuk</td>
                    <td>Uang Keluar</td>
                    <td>Saldo Akhir</td>
                </tr>
                <?php 
                    if(count($data)>0)
                    { 
                ?>
                {data}
                <tr class="cellDefault">
                    <td>{KodeBank}</td>
                    <td>{Bankname}</td>
                    <td>{NoRekening}</td>
                    <td>{SaldoAwal}</td>
                    <td>{Uangmasuk}</td>
                    <td>{Uangkeluar}</td>
                    <td>{SaldoAkhir}</td>
                </tr>
                {/data}
                <?php 
                    } 
                    else
                    {
                        echo "<tr>";
                        echo "<td colspan='9' style='text-align:center;color:red;'>No Data To Display</td>";
                        echo "</tr>";
                    } 
                ?>
            </table>
            <table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
                <tr align="center">
                    <td colspan="7">
                        <input type="submit" name="btntoxl" value="Export" />&nbsp;<input type="button" name="btnClose" value="Back" class="btn" onclick="javascript:window.location='<?php echo site_url('menuhomecontroller'); ?>';" />
                    </td>
                </tr>
            </table>
      	</form>
    	<div class="cleaner_h10"></div>
		<table align="center">
			<tr align="center">
				<td>
					<?php
						//echo $paginator;
					?>
				</td>
			</tr>
		</table>
	</div>
